<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	 <!--   <link rel="stylesheet" type="text/css" href="js/bootstarp-3.3.7/css/bootstrap.min.css"/>
		<script src="js/jquery/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstarp-3.3.7/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="js/bootstarp-table-1.11.1/bootstrap-table.min.css" />
		<script src="js/bootstarp-table-1.11.1/bootstrap-table.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstarp-table-1.11.1/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf-8"></script>
	   -->
	   <link rel="stylesheet" type="text/css" href="assets/layui-v2.4.5/layui/css/layui.css"/>
	   <script src="assets/layui-v2.4.5/layui/layui.js"></script>

		<script src="js/jquery/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery/jquery.serializejson.min.js" type="text/javascript" charset="utf-8"></script>

		<style type="text/css">
			.f {
				font-family: "微软雅黑";
				font-size: 16px;
			}
			
			.f2 {
				font-family: "微软雅黑";
				font-size: 18px;
				font-weight: bold;
				color: silver;
			}
			
			#p1,
			#p2 {
				font-family: "微软雅黑";
				font-size: 16px;
				font-weight: bold;
			}
		</style>
		<script>
			$(function() { //, headers: { 'x-requested-with': 'XMLHttpRequest' }
				$.ajaxSetup({
					crossDomain: true,
					xhrFields: {
						withCredentials: true
					}
				});
			});
		</script>

		<script>
			function getPatient(id) {
				console.log(id);
				$.ajax({
					type: "post",
					url: "http://localhost:8091/getOnePatient?patient_id=" + id,
					success: function(data) {
//						alert(data.patient[0].sex)
						layui.use(['layer', 'form'], function() {
							var layer = layui.layer,
								form = layui.form;
							if(data.patient[0].sex !=null) {
								$("input:radio[name = 'sex'][value = "+data.patient[0].sex+"]").prop("checked", true)
//								$("#woman").attr("disabled", true)
							} else {
//								$("#man").attr("disabled", true)
								$("input:radio[name = 'sex'][value = "+data.patient[0].sex+"]").prop("checked", true)
							}
							$("#username").val(data.patient[0].name)
                            $("#sex").val(data.patient[0].sex)
                            $("#birthday").val(data.patient[0].birthday)
                            $("#age").val(data.patient[0].age)
                            $("#phone").val(data.patient[0].mobile)
                            $("#address").val(data.patient[0].address)
                            $("#allergy_info").val(data.patient[0].allergy_info)
                            $("#department_id").val(data.patient[0].department_id)
                            var casecode = getCaseCode();
						    $("#ccc").html(casecode);
						})
						if(data.patientfile[0] == null) {
							$("#file").html("");
							$("#file").html("暂无该患者档案")
						} else {
							var relation = data.patientfile[0].emergency_contact_relation;
							var leftEarHearing = data.patientfile[0].left_ear_hearing;
							var rightEarHearing = data.patientfile[0].right_ear_hearing;
							var blood_type = data.patientfile[0].blood_type;
							var blood;
							var rh;
							if(blood_type[1] == 1) {
								blood = "A"
							} else if(blood_type[1] == 2) {
								blood = "B"
							} else if(blood_type[1] == 3) {
								blood = "AB"
							} else if(blood_type[1] == 4) {
								blood = "O"
							}
							if(blood_type[3] == 1) {
								rh = "阴性"
							} else if(blood_type[3] == 2) {
								rh = "阳性"
							}
							if(relation == 1) {
								relation = "父亲"
							} else if(relation == 2) {
								relation = "母亲"
							} else if(relation == 3) {
								relation = "儿子"
							} else if(relation == 4) {
								relation = "女儿"
							} else if(relation == 5) {
								relation = "亲戚"
							} else if(relation == 6) {
								relation = "朋友"
							}
							if(leftEarHearing == 1) {
								leftEarHearing = "正常"
							} else if(leftEarHearing == 2) {
								leftEarHearing = "耳聋"
							}
							if(rightEarHearing == 1) {
								rightEarHearing = "正常"
							} else if(rightEarHearing == 2) {
								rightEarHearing = "耳聋"
							}
							$("#file").html("")
							$("#file").append("<div style='font-family: 微软雅黑; font-weight: bold; font-size: 18px;'>体重：" + data.patientfile[0].weight + "kg<span style='float: right;'>身高：" + data.patientfile[0].height + "cm</span></div><div></div>")
							$("#file").append("<div style='font-family: 微软雅黑; font-weight: bold; font-size: 18px;'>血型：" + blood + "<span style='float: right;'>RH：" + rh + "</span></div><div></div>")
							$("#file").append("<div style='font-family: 微软雅黑; font-weight: bold; font-size: 18px;'>左耳听力：" + leftEarHearing + "<span style='float: right;'>右耳听力：" + rightEarHearing + "</span></div><div></div>")
							$("#file").append("<div style='font-family: 微软雅黑; font-weight: bold; font-size: 18px;'>左眼视力：" + data.patientfile[0].left_vision + "<span style='float: right;'>右眼视力：" + data.patientfile[0].right_vision + "</span></div><div></div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>个人史：" + data.patientfile[0].personal_info + "</div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>家族史：" + data.patientfile[0].family_info + "</div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>身份证：" + data.patient[0].id_card + "</div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>紧急联系人：" + data.patientfile[0].emergency_contact_name + "</div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>联系人关系：" + relation + "</div>")
							$("#file").append("<div style='font-size: 16px; font-family: 微软雅黑;'>紧急联系电话：" + data.patientfile[0].emergency_contact_mobile + "</div>")
						}
						if(data.historys[0] == null) {
							$("#historys").html("");
							$("#historys").html("暂无病历信息");
						} else {
							var type;
							var time;
							$("#historys").html("");
//							$("#c").html(data.historys[0].case_code);
								time = data.historys[0].case_date;
								if(data.historys[0].type_id == "0") {
									type = "初诊"
								} else if(data.historys[0].type_id == "1") {
									type = "急诊"
								} else {
									type = "复诊"
								}
								$("#historys").append("<div style='font-family: 楷体; font-weight: bold; font-size: 20px;'><p>" + time + "</p><p>" + type + "-" + data.historys[0].hospital_name + "-" + data.patient[0].name + "</p></div>")
								$("#historys").append("<div style='font-family: 微软雅黑; font-size: 16px;'><p>发病日期：" + data.historys[0].case_date + "</p><p>主诉：" + data.historys[0].case_title + "</p><p>诊断信息：" + data.historys[0].case_result + "</p><p>医生建议：" + data.historys[0].doctor_tips + "</p></div><br />")
							}
					}
				});
			}

			$(function() {
				var url = window.location.search;
				var str = url.split('?')[1];
				if(url != '') {
					var data = str.split('&');
					$.each(data, function(m, n) {
						var id = n.split('=')[1]
						if(m == 0) {
							//							alert(id)
							$("#hzid").val(id)

						}
						if(m == 1) {
							$("#ghid").val(id)

						}
					});
					getPatient($("#hzid").val())

				}

				layui.use(['layer', 'form', 'laydate', 'element', 'table'], function() {
					var layer = layui.layer,
						form = layui.form,
						layedit = layui.layedit,
						laydate = layui.laydate,
						table = layui.table,
						element = layui.element;

					tab1()

					//日期控件
					//					laydate.render({
					//
					//						elem: '#birthday',
					//						done: function(value, date) {
					//							var d = new Date();
					//							var b = new Date(value)
					//
					//							if(d.getTime() < b.getTime()) {
					//								layer.alert("生日不能大于当前日期")
					//								$("#birthday").val("")
					//								$("#age").val("")
					//
					//							} else {
					//
					//								$("#age").val(getAge(value))
					//							}
					//						}
					//					});

					laydate.render({
						elem: '#morbidity',

					})

					//表单验证
					form.verify({
						username: function(value, item) {

							if(value.length == 0) {
								return "请先选择患者";

							}

						}

					})

					//表单监听

					form.on('submit(tj)', function(data) {
						var case_code = $("#ccc").html();
						var patient_id = $("#hzid").val();
						var case_date = $("#morbidity").val();
						var type_id = $("#type_id").val();
						var is_contagious = $("#is_contagious").val();
						var case_title = $("#case_title").val();
						var case_result = $("#case_result").val();
						var doctor_tips = $("#doctor_tips").val();
						var memo = $("#memo").val();
						var department_id = $("#department_id").val();
						var use_tips = $("#use_tips").val();
						var china_memo = $("#china_memo").val();
						var sum = $("#sum").val();
						console.log(sum);
						$.ajax({
							type: "post",
							url: "http://localhost:8091/shouFei",
                            data: {
                            	"case_code": case_code,
                            	"sum":sum,
                            	"china_memo": china_memo,
                            	"use_tips":use_tips,
                            	"department_id":department_id,
                            	"memo": memo,
                            	"doctor_tips": doctor_tips,
                            	"case_result":case_result,
                            	"case_title":case_title,
                            	"type_id":type_id,
                            	"is_contagious": is_contagious,
                            	"case_date":case_date,
                            	"patient_id":patient_id,
//                          	"case_date": case_date,
                            },
//							dataType: "json",
							success: function(data) {
								if(data.msg == 'true') {
									layer.msg("就诊完成，请收好收费单据去缴费！", {
										anim: 3,
										icon: 6,
										time: 1500,
										end: function() {
											location.reload();
											$("#address").val("");
											$("#birthday").val("");
											$("#allergy_info").val("");
											$("#case_result").val("");
											$("#case_title").val("");
											$("#doctor_tips").val("");
											$("#use_tips").val("");
											$("#memo").val("");
											$("#china_memo").val("");
										}
									})
								} else {
									layer.msg("就诊完成，您的身体状况良好无需开处方！", {
										anim: 3,
										icon: 6,
										time: 1500,
										end: function() {
											location.reload();
											$("#address").val("");
											$("#birthday").val("");
											$("#allergy_info").val("");
											$("#case_result").val("");
											$("#case_title").val("");
											$("#doctor_tips").val("");
											$("#use_tips").val("");
											$("#memo").val("");
											$("#china_memo").val("");
										}
									})

								}

							}
						});
					});

					table.on('edit(ptab)', function(obj) {
						var value = obj.value,
							data = obj.data,
							field = obj.field;
//							tab()
//							$(".pf").each(function(){
//							$(this).html(data.many * data.unitprice)
							if(data.keywords!=null){
								$("#" +"药"+ data.mname + "").html("" + data.many * data.unitprice + "");
								$("#sum").val(data.many * data.unitprice);
							} else if(data.hid!=null){
								$("#" +"附"+ data.mname + "").html("" + data.many * data.unitprice + "")
								$("#sum").val(data.many * data.unitprice);
							} else if(data.class_id!=null){
								$("#" +"检"+ data.mname + "").html("" + data.many * data.unitprice + "")
								$("#sum").val(data.many * data.unitprice);
							}
                            var sum = $("#sum").val();
                            var s = parseInt(sum);
                            console.log(s);
						layer.msg('数量已更改');
						})
						
					});


			})

			//			function getAge(birthday) {
			//				var mydate = new Date();
			//				var mydateMounth = mydate.getMonth();
			//				var bir = new Date(birthday)
			//				var birMounth = bir.getMonth();
			//				//算年龄
			//				var sumMydateMounth = mydate.getFullYear() * 12 + (mydateMounth + 1)
			//				var sumBirMounth = bir.getFullYear() * 12 + (birMounth + 1)
			//				//算年龄
			//				var m = (sumMydateMounth - sumBirMounth) / 12
			//				//算周岁零几个月
			//				var yushu = (sumMydateMounth - sumBirMounth) % 12
			//
			//				if(m < 1) {
			//					if(yushu < 1) {
			//						return "未满月";
			//					}
			//					return yushu + "个月";
			//				} else if(yushu < 1) {
			//					return m + "周岁";
			//				} else {
			//
			//					return parseInt(m) + "周岁" + parseInt(yushu) + "个月";
			//				}
			//			}

			function showPatient() {

				layer.open({
					type: 2 //Page层类型
						,
					area: ['800px', '500px'],
					title: '选择挂号患者',
					shade: 0.6 //遮罩透明度
						,
					maxmin: true //允许全屏最小化
						,
					anim: 1 //0-6的动画形式，-1不开启
						,
					content: 'zhd/choosehz.html',
					end: function() {

						if($("#hzid").val().length == 0) {
							layer.msg("获取信息失败")
						} else {
//							alert($("#hzid").val());
							getPatient($("#hzid").val())
						}
					}
				});
			}
			function timestampToTime(timestamp) {
				var date = new Date(timestamp * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() + ' ';
				var h = date.getHours() + ':';
				var m = date.getMinutes();
				if(h < 10) {
					h = "0" + h;
				} else if(m < 10) {
					m = "0" + m;
				}

				return Y + M + D + h + m;
			}

			function showFjf() {
				if($("#username").val()==""){
					alert("请选择患者");
					return;
				}
				layer.open({
					type: 2 ,//Page层类型
					area: ['50%', '70%'],
					title: '附加费项',
					shade: 0.6, //遮罩透明度
					maxmin: true, //允许全屏最小化
					anim: 1 ,//0-6的动画形式，-1不开启
					content: 'zhd/choosefjf.html',
					end: function() {
						if($("#fjfIdStr").val().length != 0) {
							tab()
							layer.msg("添加成功", {
								time: '2000',
							})
						} else {
							layer.msg("无数据", {
								time: '2000',
							})
						}
					}
				})
			}
			function showDrug() {
				if($("#username").val()==""){
					alert("请选择患者");
					return;
				}
				layer.open({
					type: 2, //Page层类型
					area: ['800px', '600px'],
					title: '选择药品/项目',
					shade: 0.6 ,//遮罩透明度
					maxmin: true, //允许全屏最小化
					anim: 1 ,//0-6的动画形式，-1不开启
					content: 'zhd/choosedrug.html',
					end: function() {
						if($("#drugIdStr").val().length != 0 || $("#cfIdStr").val().length != 0) {
							tab()
							layer.msg("添加成功", {
								time: '2000',
							})
						} else {
							layer.msg("无数据", {
								time: '2000',
							})
						}

					}
				});

			}


			function tab1() {
				layui.use('table', function() {
					var table = layui.table;
					table.render({
						elem: '#prescriptionTab',
						cellMinWidth: 80,
						height: 177,
						cols: [
							[{
								align: 'center',
								field: 'name',
								title: '费用编号',
							}, {
								align: 'center',
								field: 'uid',
								title: '费用名称',
							}, {
								align: 'center',
								field: 'uid',
								title: '数量',
							}, {
								align: 'center',
								field: 'username',
								title: '单价(元)',
								sort: true
							}, {
								align: 'center',
								field: 'password',
								title: '金额',
								sort: true
							}, {
								field: 'password',
								title: '操作',
							}]
						]
					});
				});
			}

			function tab() {
				var mediid = $("#drugIdStr").val().split(",")
				var insid = $("#cfIdStr").val().split(",")
				var preid = $("#fjfIdStr").val().split(",")

//              
				layui.use('table', function() {
					var table = layui.table,
						layer = layui.layer;
					table.render({
						elem: '#prescriptionTab',
						url: 'http://localhost:8091/selectCost?ins_id=' + insid + "&pre_id=" + preid + "&medicines_id=" + mediid,
						cellMinWidth: 80,
						page: true,
						height: 200,
						cols: [[
						    {
								align: 'center',
								field: "mname",
								title: '药品编号',
								templet:function(d){
								if(d.keywords!=null){
									return '<font>' +"药"+ d.mname + '</font>';
								}
								if(d.hid!=null){
									return '<font>' +"附"+d.mname + '</font>';
								}
								if(d.class_id!=null){
									return '<font>' +"检"+ d.mname + '</font>';
								}
								}
							},{
								align: 'center',
								field: "costname",
								title: '药品名称',
							}, {
								align: 'center',
								field: 'many',
								title: '数量',
								edit: 'text',
							}, {
								align: 'center',
								field: 'unitprice',
								title: '单价',
							}, {
								align: 'center',
								field: 'sumprice',
								title: '金额',
								templet: function(d) {
								if(d.keywords!=null){
									return '<font id='+"药"+d.mname+'>' + d.unitprice * d.many + '</font>';
								}
								if(d.hid!=null){
									return '<font id='+"附"+d.mname+'>' + d.unitprice * d.many + '</font>';
								}
								if(d.class_id!=null){
									return '<font id='+"检"+d.mname+'>' + d.unitprice * d.many + '</font>';
								}
								}
							}, {
								align: 'center',
								field: 'password',
								title: '操作',
								toolbar: '#dell',
							}
							  ]]

					});
					table.on('tool(ptab)', function(obj) {

						var data = obj.data;
						//						alert(data.name)
						var y = new RegExp("药");
						var x = new RegExp("项");
						var f = new RegExp("附");
						//						alert(y)
						if(obj.event === 'del') {
							layer.confirm('确定删除？', function(index) {

								obj.del();
								layer.close(index);
								layer.msg("删除成功")
								if(y.test(data.name)) {
									var me = $.inArray(data.name.substr(1), mediid)
									if(me >= 0) {
										mediid.splice(me, 1)
										$("#drugIdStr").val(mediid)

									}
								}
								if(f.test(data.name)) {
									var fj = $.inArray(data.name.substr(1), preid)

									if(fj >= 0) {
										preid.splice(fj, 1)
										$("#fjfIdStr").val(preid)
									}
								}
								if(x.test(data.name)) {
									var xm = $.inArray(data.name.substr(1), insid)
									if(xm >= 0) {
										insid.splice(xm, 1)
										$("#cfIdStr").val(insid)

									}
								}
							});

						}
					});

				});
			}
			

			
			function getCaseCode() {
				var code = new Date();
				var year = code.getFullYear();
				var mon = code.getMonth();
				var day = code.getDay();
				var hour = code.getHours();
				var min = code.getMinutes();
				var secon = code.getSeconds();
				var ms = code.getMilliseconds();
				var caseCode = year + "" + mon + "" + day + "" + hour + "" + min + "" + secon + "" + ms
				return caseCode;
			}
		</script>

		<script type="text/html" id="dell">
			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		</script>
	</head>

	<body style="background-color: #F3F5F7;">
		
        <input type="hidden" name="" id="drugIdStr" value="" />
		<input type="hidden" name="" id="cfIdStr" value="" />
		<input type="hidden" name="" id="fjfIdStr" value="" />
		<input type="hidden" name="department_id" id="department_id" value="" />
		<input type="hidden" name="sum" id="sum" value="" />
		<input type="hidden" name="sum" id="sum1" value="" />
		<input type="hidden" name="sum" id="sum2" value="" />
		<input type="hidden" name="sum" id="sum3" value="" />
		<form class="layui-form" lay-filter="patientMsg" id="careForm">
			<div style="padding: 20px;">

				<div class="layui-row layui-col-space10">

					<!--患者信息-->
					<div class="layui-col-md6">
						<div class="layui-card" style="background-color:#F9F9F9; height: 90%;">

							<div class="layui-card-header" style="font-family: '微软雅黑'; font-size: 20px; font-weight:bold;">患者信息<button style="margin-left: 50px;" type="button" class="layui-icon layui-icon-friends layui-btn layui-btn-primary layui-btn-radius" onclick="showPatient()"> 选择患者</button></div>
							<div class="layui-card-body" style="height: 700px;">

								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label f">患者姓名</label>
										<div class="layui-input-inline">
											<input type="text" name="username" id="username" lay-verify="username" disabled="disabled" autocomplete="off" placeholder="获取患者姓名" class="layui-input">
										</div>

									</div>
									<div class="layui-inline">
										<label class="layui-form-label f">性别</label>
										<div class="layui-input-inline">
											<input type="radio" id="man" name="sex" value="1" title="男">
                                            <input type="radio" id="woman" name="sex" value="2" title="女" checked="checked">
										</div>
									</div>
								</div>

								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label f">生日</label>
										<div class="layui-input-inline">
											<input type="text" name="birthday" id="birthday" disabled="disabled" placeholder="获取患者生日" class="layui-input">

										</div>
									</div>

									<div class="layui-inline">
										<label class="layui-form-label f">年龄</label>
										<div class="layui-input-inline">
											<input type="text" name="age" id="age" disabled="disabled" value="" autocomplete="off" placeholder="年龄自动生成" class="layui-input">
										</div>
									</div>

								</div>
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label f">手机号</label>
										<div class="layui-input-inline">
											<input type="text" name="phone" id = "phone" disabled="disabled" autocomplete="off" placeholder="获取患者手机号码" class="layui-input">
										</div>
									</div>

								</div>

								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label f">家庭住址</label>
									<div class="layui-input-block">
										<textarea name="address" placeholder="获取当前患者住址" disabled="disabled" class="layui-textarea" id="address" style="position: relative;top: -10px;"></textarea>
									</div>
								</div>
								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label f">过敏史</label>
									<div class="layui-input-block">
										<textarea name="gms" id="allergy_info" disabled="disabled" placeholder="获取患者过敏历史" class="layui-textarea" style="position: relative;top: -10px;"></textarea>
									</div>
								</div>

								<div class="layui-tab layui-tab-card" style="position: relative;top: -22px;width: 519px;left: -15px;">
									<ul class="layui-tab-title">
										<li class="layui-this" style="width: 44%;" id="p1">患者档案</li>
										<li style="width: 38%;" id="p1">历史病历</li>

									</ul>
									<div class="layui-tab-content" style="height: 180px; overflow: auto;">
										<div class="layui-tab-item layui-show" id="file">
											请选择患者
										</div>
										<div class="layui-tab-item" id="historys">
											请选择患者
										</div>

									</div>
								</div>

							</div>
						</div>

					</div>

					<!--病例 处方-->
					<div class="layui-col-md6">

						<div class="layui-card">
							<div class="layui-tab">

								<ul class="layui-tab-title">

									<li class="layui-this" id="p2">病历</li>
									<li id="p2">处方</li>

								</ul>

								</ul>
								<!--病例-->

								<div class="layui-tab-content" style="height: 700px;">
									<div class="layui-tab-item layui-show">
										<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
											<legend style="font-weight: bold; color: skyblue; font-family: '微软雅黑'; ">诊断信息
												<font style="font-size: 16px; color: lightgray;">诊断编号:</font>
												<font style="font-size: 16px; color: #B9BBBE;" id="ccc"></font>
												<!--<input type="text" name="case_code" id="c"  style="border: 0px;"/>-->

											</legend>

										</fieldset>
										<input type="hidden" name="patient_id" id="hzid" value="" />
										<input type="hidden" name="reg_id" id="ghid" value="" />

										<div class="layui-form-item">
											<div class="layui-inline">
												<label class="layui-form-label f">发病日期:</label>
												<div class="layui-input-inline" style="width: 100px;">
													<input type="text" name="case_date" id="morbidity" placeholder="发病日期" class="layui-input" value="2000-01-01">

												</div>
											</div>

											<div class="layui-inline">
												<label class="layui-form-label f">接诊类型:</label>
												<div class="layui-input-inline" style="width: 80px;">
													<select name="type_id" id="type_id">
														<option value="0">初诊</option>
														<option value="1">复诊</option>
														<option value="2">急诊</option>
													</select>
												</div>
											</div>
											<div class="layui-inline">
												<label class="layui-form-label f">是否传染:</label>
												<div class="layui-input-inline" style="width: 80px;">
													<select name="is_contagious" id="is_contagious">

														<option value="0">是</option>
														<option value="1">否</option>

													</select>
												</div>
											</div>

										</div>

										<div class="layui-form-item">
											<div class="layui-form-item layui-form-text">
												<label class="layui-form-label f2">主诉:</label>
												<div class="layui-input-block">
													<textarea name="case_title" placeholder="请填写主诉病状(限500字)" class="layui-textarea" id="case_title"></textarea>
												</div>
											</div>

										</div>

										<div class="layui-form-item">
											<div class="layui-form-item layui-form-text">
												<label class="layui-form-label f2">诊断详情:</label>
												<div class="layui-input-block">
													<textarea name="case_result" placeholder="填写本次诊断内容(限500字)" class="layui-textarea" id="case_result"></textarea>
												</div>
											</div>

										</div>
										<div class="layui-form-item">
											<div class="layui-form-item layui-form-text">
												<label class="layui-form-label f2">医生建议:</label>
												<div class="layui-input-block">
													<textarea name="doctor_tips" placeholder="请填写医生建议(限500字)" class="layui-textarea" id="doctor_tips"></textarea>
												</div>
											</div>

										</div>
										<div class="layui-form-item">
											<div class="layui-form-item layui-form-text">
												<label class="layui-form-label f2">备注:</label>
												<div class="layui-input-block">
													<textarea name="memo" placeholder="请填写备注(限500字)" class="layui-textarea" id="memo"></textarea>
												</div>
											</div>

										</div>
										<br />
										<table border="0" align="center" style="text-align: center;">
											<tr>
												<td>

													<font class="layui-icon layui-icon-rmb" style="font-size: 30px; color: red;"></font>
													<font style="font-family:'楷体'; font-size: 26px;">未收费</font>

												</td>

											</tr>

										</table>

									</div>
									<div class="layui-tab-item">

										<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
											<ul class="layui-tab-title">
												<li class="layui-this" style="font-size: 20px; font-family: '楷体';">添加处方</li>
											</ul>
											<div class="layui-tab-content">
												<div class="layui-tab-item layui-show">
													<div>
														<table class="layui-hide" id="prescriptionTab" lay-filter="ptab" style="height: 200px;">
															
														</table>

													</div>
												</div>

											</div>

										</div>
										<br />
										<button type="button" onclick="showFjf()" class="layui-btn layui-btn layui-icon layui-icon-add-circle"> 附加费用</button>
										<button type="button" onclick="showDrug()" class="layui-btn layui-btn-normal layui-icon layui-icon-add-circle"> 添加药品</button>

										<br />
										<br />
										<br />

										<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
											<ul class="layui-tab-title">
												<li class="layui-this" style="font-size: 20px; font-family: '楷体';">医生嘱咐</li>

											</ul>
											<br />
											<br />
											<br />
											<div class="layui-tab-item layui-show">

												<div class="layui-form-item layui-form-text">
													<label class="layui-form-label f2">服药要求</label>
													<div class="layui-input-block">
														<textarea name="use_tips" placeholder="填写医生建议(限500字,选填)" class="layui-textarea" id="use_tips"></textarea>
													</div>
												</div>
												<div class="layui-form-item layui-form-text">
													<label class="layui-form-label f2">中药备注</label>
													<div class="layui-input-block">
														<textarea name="drugmemo" placeholder="填写中药备注(限500字，选填)" class="layui-textarea" id="china_memo"></textarea>
													</div>
												</div>
											</div>
										</div>

									</div>

								</div>

							</div>

						</div>

					</div>

				</div>

			</div>
			<table align="center" style="text-align: center;" width="200">

				<tr>

					<td>
						<button type="button" lay-submit="" lay-filter="tj" class="layui-btn layui-btn-normal layui-btn-radius layui-icon layui-icon-file"> 保存</button>
					</td>
				</tr>
				<tr>

					<td height="10">

					</td>
				</tr>

			</table>
		</form>
	</body>

</html>